<form class="form-horizontal" method="post" action="<?$this->element->getAction()?>">
    <div class="control-group">
        <label class="control-label" for="title">Tiêu đề</label>
        <div class="controls">
            <?=$this->element->title?>                                    
            <p class="help-block"></p>
        </div>                
    </div>                
    <div class="control-group">
        <label class="control-label" for="typeahead">Danh mục tin cấp 1</label>
        <div class="controls">
            <?=$this->element->newscat?>            
            <p class="help-block"></p>
        </div>                
    </div>
    <div class="control-group">
        <label class="control-label" for="typeahead">Danh mục tin cấp 2</label>
        <div class="controls">
            <?=$this->element->newsitem?>            
            <p class="help-block"></p>
        </div>                
    </div>
    
    <div class="control-group">
        <label class="control-label" for="typeahead">Link</label>
        <div class="controls">
            <?=$this->element->link?>            
            <p class="help-block"></p>
        </div>                
    </div>    
    <div class="control-group">
        <label class="control-label" for="typeahead">Mô tả ngắn</label>
        <div class="controls">            
                <?=$this->element->description?>                        
            <p class="help-block"></p>
        </div>                
    </div>
    <div class="control-group">
        <label class="control-label" for="typeahead">Nội dung tin</label>
        <div class="controls">            
                <?=$this->element->content?>                                                
            <p class="help-block"></p>
        </div>                
    </div>    
</form>
<script type="text/javascript">
    CKEDITOR.replace('description',{height: 500 });
    CKEDITOR.replace('content',{height: 500 });
</script>
<script type="text/javascript">
    $(document).ready(function(){
        $('select#newscat').change(function(){            
            var id_cat=$(this).val();
            alert(id_cat);
            $.ajax({
                type: "POST",
                url: "<?=BASE_URL?>/admin/news/get_newsitem_by_catid/id/"+id_cat,                    
                //data: id_cat,                
                dataType: 'json',
                success: function(data) {
                    $('select#danhmuc2 option[value!="0"]').remove();
                    for(var key in data)
                    {                        
                        $('select#danhmuc2').append(new Option(data[key],key));
                    }                    
                    //alert("AJAX call successful and this data was returned: " + data);                    
                },
                error: function() {
                    alert("AJAX call an epic failure");
                }
            });
            return false;                       
        });
    });   
</script>
